xui.text = {
    xui = 'text',
    value = '', --文本内容
    font = 'Fonts\\dfst-m3u.ttf', --魔兽默认字体
    textsize = 0.00,
    align = 0,

    on_sys_wheel = function (self, frame, key)
        if self.state == 'disable' then
            return
        end

        local on = self.on_wheel
        if type(on) == "function" then
            on(self, key)
        end

        if self.parent.xui == 'panel' then
            self.parent:on_sys_wheel(frame,key)
        end

    end,
}
xui:extends(xui.base)( xui.text )

function xui.text:new( params )
    if not params then params = {} end
    local text = self:create( 'TEXT', params.name, params.parent, params.template, params.id )
    xui:save( text.frame, text )
    return text + params
end

local DzFrameSetText = japi.DzFrameSetText
xui.text:set_property('value','set',function (class, this, key, value)
    this.data[key] = value
    DzFrameSetText( this.frame , this.value )
end)

local DzFrameSetFont = japi.DzFrameSetFont
xui.text:set_property('font','set',function (class, this, key, value)
    if value == '' or value == nil then
        this.data[key] = 'Fonts\\dfst-m3u.ttf'
    else
        this.data[key] = value
    end
    DzFrameSetFont( this.frame, this.font, this.fontsize, 0) --[[flag]]
end)

xui.text:set_property('fontsize','set',function (class, this, key, value)
    this.data[key] = value
    DzFrameSetFont( this.frame, this.font, this.fontsize, 0)
end)

local DzFrameSetTextAlignment = japi.DzFrameSetTextAlignment
xui.text:set_property('align','set',function (class, this, key, value)
    this.data[key] = value
    DzFrameSetTextAlignment(this.frame, 100)
    DzFrameSetTextAlignment(this.frame, this.align)
end)



